function e2_showbasis
clear
h=clf;
k=1;
for i=1:4
    for j=1:4
        subplot(16,i,j);
        a = load(['face0_grid_16_' num2str(k) '.raw']);
        A = build_image(a);
        imshow(A);
        k = k+1;
    end
end
print(h, '-depsc', '-tiff', '-r300', 'face0_grid_16_basis.eps');
end

function A = build_image(a)
    m = 8; n = 8;
    i_m = 19; i_n = 19;
    A = zeros(m*i_m, n*i_n);
    k = 1;
    for i=1:m
        for j=1:n
            A( (i-1)*i_m+1 : i*i_m , (j-1)*i_n+1 : j*i_n) = ...
                reshape(a(:,k), i_m, i_n);
            k = k+1;
        end
    end
    A = 1 - A;
end